<template>
  <div class="category">
    <h2>{{ title }}分类</h2>
    <!-- 定义一个作用域插槽 -->
    <slot :games="games"></slot>
  </div>
</template>

<script>
export default {
  name: "Category",
  props: ["title"],
  data() {
    return {
      games: ["红色警戒", "穿越火线", "地下城与勇士", "英雄联盟"],
    };
  },
};
</script>

<style scoped>
h2 {
  background-color: orange;
  text-align: center;
}
.category {
  width: 200px;
  height: 300px;
  background-color: skyblue;
}
</style>